package judesart.app.client.controller;

import java.util.List;

import judesart.app.domain.Artwork;
import judesart.app.shared.ArtworkShort;
import judesart.app.shared.SearchResult;
import judesart.app.shared.SelectProject;
import judesart.app.shared.ValidationException;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("artwork")
public interface ArtworkController extends RemoteService {
    public static class Util {
        private static ArtworkControllerAsync instance;

        public static ArtworkControllerAsync getInstance() {
            if (instance == null) {
                instance = GWT.create(ArtworkController.class);
            }
            return instance;
        }
    }

    Artwork createArtwork(Artwork artwork) throws ValidationException;

    Artwork updateArtwork(Artwork artwork) throws ValidationException;

    SearchResult<ArtworkShort> searchArtworks(int startAt, int maxElements, String sortField, boolean asc);

    Artwork getArtwork(Long id);

    void deletePhotoFromArtwork(Long artworkId, Long imageId);

    void deleteArtwork(Long artworkId);

    List<SelectProject> getSelectProjectValues(Long artworkId);

    ArtworkShort getRandomArtwork(Long artistId);

    void sendMessage(String email, String header, String message, Long artworkId);
}
